{{csrf_field()}}
<div class="box-body">
    <div class="form-group{{ $errors->has('title') ? ' has-error' : '' }}">
        <label for="inputTitle" class="col-sm-2 control-label">新闻标题</label>
        <div class="col-sm-10">
            <input type="text" name="title" value="{{$news->title}}" class="form-control" required id="inputTitle" placeholder="请输入标题">
            @if($errors->has('name'))
                <span class="help-block">
                      <strong>{{ $errors->first('name') }}</strong>
                 </span>
            @endif
        </div>
    </div>
    <div class="form-group{{ $errors->has('parent_id') ? ' has-error' : '' }}">
        <label for="inputCategoryId" class="col-sm-2 control-label">所属分类</label>
        <div class="col-sm-10">
            <select class="form-control" id="inputCategoryId" name="category_id">
                @foreach($newsCategories as $newsCategory)
                <option value="{{$newsCategory->id}}" {{$newsCategory->id==$news->category_id?'selected=selected':''}}>{{$newsCategory->name_text}}</option>
                @endforeach
            </select>
            @if($errors->has('category_id'))
                <span class="help-block">
                    <strong>{{ $errors->first('category_id') }}</strong>
                </span>
            @endif
        </div>
    </div>
    <div class="form-group{{ $errors->has('meta_keyword') ? ' has-error' : '' }}">
        <label for="inputMetaKeyword" class="col-sm-2 control-label">页面关键字</label>
        <div class="col-sm-10">
            <input type="text" name="meta_keyword"  value="{{$news->meta_keyword}}"  class="form-control" required id="inputMetaKeyword" placeholder="蜘蛛侠、煎饼侠">
            @if($errors->has('meta_keyword'))
                <span class="help-block">
                      <strong>{{ $errors->first('meta_keyword') }}</strong>
                 </span>
            @endif
        </div>
    </div>
    <div class="form-group{{ $errors->has('meta_description') ? ' has-error' : '' }}">
        <label for="meta_description" class="col-sm-2 control-label">页面描述</label>
        <div class="col-sm-10">
            <input type="text" name="meta_description"  value="{{$news->meta_description}}"  class="form-control" required id="meta_description" placeholder="请输入页面描述">
            @if($errors->has('meta_description'))
                <span class="help-block">
                      <strong>{{ $errors->first('meta_description') }}</strong>
                 </span>
            @endif
        </div>
    </div>
    <div class="form-group{{ $errors->has('page_image') ? ' has-error' : '' }}">
        <label for="page_image" class="col-sm-2 control-label">文章图片</label>
        <div class="col-sm-10">
            <input type="file" name="page_image" class="form-control" required id="page_image" placeholder="请输入页面描述">
            @if($errors->has('page_image'))
                <span class="help-block">
                      <strong>{{ $errors->first('page_image') }}</strong>
                 </span>
            @endif
        </div>
    </div>
    <div class="form-group{{ $errors->has('summarty') ? ' has-error' : '' }}">
        <label for="summarty" class="col-sm-2 control-label">文章摘要</label>
        <div class="col-sm-10">
            <textarea name="summarty" class="form-control" rows="6" required id="summarty" placeholder="请输入页面摘要">{{$news->summarty}}</textarea>
            @if($errors->has('summarty'))
                <span class="help-block">
                      <strong>{{ $errors->first('summarty') }}</strong>
                 </span>
            @endif
        </div>
    </div>
    <div class="form-group{{ $errors->has('content') ? ' has-error' : '' }}">
        <label for="content" class="col-sm-2 control-label">正文</label>
        <div class="col-sm-10">
            <textarea name="content" class="form-control" rows="6" required id="content" placeholder="请输入页面正文">{{$news->content}}</textarea>
            @if($errors->has('content'))
                <span class="help-block">
                      <strong>{{ $errors->first('content') }}</strong>
                 </span>
            @endif
        </div>
    </div>
    <div class="form-group{{ $errors->has('views') ? ' has-error' : '' }}">
        <label for="views" class="col-sm-2 control-label">浏览量</label>
        <div class="col-sm-10">
            <input type="text" name="views" class="form-control" required id="views" value="{{$news->views}}" placeholder="100">
            @if($errors->has('views'))
                <span class="help-block">
                      <strong>{{ $errors->first('views') }}</strong>
                 </span>
            @endif
        </div>
    </div>
    <div class="form-group{{ $errors->has('status') ? ' has-error' : '' }}">
        <label for="status" class="col-sm-2 control-label">发布状态</label>
        <div class="col-sm-10">
            <select name="status" class="form-control" required id="status" placeholder="100">
                <option value="0" {{$news->status==0?'selected="selected"':''}}>草稿</option>
                <option value="1" {{$news->status==1?'selected="selected"':''}}>已发布</option>
            </select>
            @if($errors->has('status'))
                <span class="help-block">
                      <strong>{{ $errors->first('status') }}</strong>
                 </span>
            @endif
        </div>
    </div>
</div>
<!-- /.box-body -->
<div class="box-footer">
    <button type="reset" class="btn btn-default col-md-1 col-md-offset-4">重置</button>
    <button type="submit" class="btn btn-info col-md-1 col-md-offset-1">提交</button>
</div>
<!-- /.box-footer -->